package pl.prv.polanie.client.dto;

import com.google.gwt.user.client.rpc.IsSerializable;


public class CSSubjectEventDTO extends java.lang.Object implements IsSerializable, ICSDTO, Comparable<CSSubjectEventDTO> {


    // Fields    

     private long id;
     /**
      *  0 - zajecia odbywaja sie w kazdym tygodniu
      *  1 - parzysty (dolny lewy) 
      *  2 - nieparzysty (gorny prawy)
      */ 
     private int eventSort;
     private long subjectID;
     private long roomID;
     private long subgroupID;
     private long lecturerID;
     private long calendarDayID;
     
     private long groupID;
     private long semesterID;
     
     private Integer startTime;
     private Integer duration;


    // Constructors
     /** full constructor */
    public CSSubjectEventDTO(long id, int eventSort, long subjectID,
			long roomID, long subgroupID, long lecturerID, long calendarDayID,
			long groupID, long semesterID,
			Integer startTime, Integer duration) {
		super();
		this.id = id;
		this.eventSort = eventSort;
		this.subjectID = subjectID;
		this.roomID = roomID;
		this.subgroupID = subgroupID;
		this.lecturerID = lecturerID;
		this.calendarDayID = calendarDayID;
		this.groupID = groupID;
		this.semesterID = semesterID;
		this.startTime = startTime;
		this.duration = duration;
	}

	/** default constructor */
    public CSSubjectEventDTO() {
    }

	public String toLabel() {
		String r;
		
		r = "id." + id + " -> cd: " + calendarDayID + ", startTime: " + startTime; 
		return r;
	}

	public String toString() {
		String result = "" +
			"[ " + CSSubjectEventDTO.class + "]" +
			"id: " + id +
			", eventSort: " + eventSort +
			", subjectID: " + subjectID +
			", roomID: " + roomID +
			", subgroupID: " + subgroupID +
			", lecturerID: " + lecturerID +
			", calendarDayID: " + calendarDayID +
			", startTime: " + startTime +
			", duration: " + duration; 
		return result;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public int getEventSort() {
		return eventSort;
	}

	public void setEventSort(int eventSort) {
		this.eventSort = eventSort;
	}

	public long getSubjectID() {
		return subjectID;
	}

	public void setSubjectID(long subjectID) {
		this.subjectID = subjectID;
	}

	public long getRoomID() {
		return roomID;
	}

	public void setRoomID(long roomID) {
		this.roomID = roomID;
	}

	public long getSubgroupID() {
		return subgroupID;
	}

	public void setSubgroupID(long subgroupID) {
		this.subgroupID = subgroupID;
	}

	public long getLecturerID() {
		return lecturerID;
	}

	public void setLecturerID(long lecturerID) {
		this.lecturerID = lecturerID;
	}

	public long getCalendarDayID() {
		return calendarDayID;
	}

	public void setCalendarDayID(long calendarDayID) {
		this.calendarDayID = calendarDayID;
	}

	public Integer getStartTime() {
		return startTime;
	}

	public void setStartTime(Integer startTime) {
		this.startTime = startTime;
	}

	public Integer getDuration() {
		return duration;
	}

	public void setDuration(Integer duration) {
		this.duration = duration;
	}

	public long getGroupID() {
		return groupID;
	}

	public void setGroupID(long groupID) {
		this.groupID = groupID;
	}

	public long getSemesterID() {
		return semesterID;
	}

	public void setSemesterID(long semesterID) {
		this.semesterID = semesterID;
	}

	public int compareTo(CSSubjectEventDTO o) {
		if (this.calendarDayID > o.calendarDayID) {
			return 1;
		}
		if (this.calendarDayID < o.calendarDayID) {
			return -1;
		}
		return (this.startTime.compareTo(o.startTime));
	}




}